/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author dvasquez
 */
@Embeddable
public class MaterialesHormigonPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "material")
    private String material;
    @Basic(optional = false)
    @Column(name = "ID")
    private int id;

    public MaterialesHormigonPK() {
    }

    public MaterialesHormigonPK(String material, int id) {
        this.material = material;
        this.id = id;
    }

    public String getMaterial() {
        return material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (material != null ? material.hashCode() : 0);
        hash += (int) id;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MaterialesHormigonPK)) {
            return false;
        }
        MaterialesHormigonPK other = (MaterialesHormigonPK) object;
        if ((this.material == null && other.material != null) || (this.material != null && !this.material.equals(other.material))) {
            return false;
        }
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.MaterialesHormigonPK[material=" + material + ", id=" + id + "]";
    }

}
